﻿#pragma once
#include <array>
#include <vector>

namespace QtVtkModle
{
    namespace Global
    {
        // Global variable for set the vtk object property
        const std::array<double, 3> CircleLineColor = { 0,0,1 };
        const double CircleLineWidth = 5;

        const std::array<double, 3> ConeColor = { 1, 0.8, 0 };
        const double  ConeResolution = 100;

        const std::array<double, 3> CubeColor = { 0.0, 1, 1 };

        const std::array<double, 3> CylinderColor = { 0.0, 0.0, 1.0 };

        const std::array<double, 3> LineColor = { 0, 1, 0 };
        const double LineWidth = 5;

        const std::array<double, 3> PlaneColor = { 1, 0, 0 };

        const std::array<double, 3> PointColor = { 0, 0, 1 };
        const double PointSize = 14;

        const std::array<double, 3> RectangleColor = { 1,0,1 };

        const std::array<double, 3> SphereColor = { 1, 0, 0 };
        const double SpherePhiResolution = 100;
        const double SphereThetaResolution = 100;

        const std::array<double, 3> TorusColor = { 0, 1, 0 };
        const double TorusLineWidth = 5;

        const std::array<double, 3> VolumeColor = { 0, 1, 0 };
    }


    //class:: Global variable for set the vtk object property
    class GlobalValue
    {

    public:
        static const int CircleColorSize = 3;//static const int;only "const int" can be static const and initialized in header file
        static double CircleLineColor[CircleColorSize];//static variable  = { 0,0,1 };
        static double CircleLineWidth;//static variable = 5;


        //glaobal function
        static double GetCircleLineWidth()
        {
            return Global::CircleLineWidth;
        }


        static void GetCircleWidthAndColor(std::vector<double>& vecWidthAndColor)
        {

            vecWidthAndColor.resize(0);//clear vector
            vecWidthAndColor.reserve(CircleColorSize + 1);//reserve memory for vector
            vecWidthAndColor.push_back(CircleLineWidth);

            for( auto itor : CircleLineColor )
            {
                //color.emplace_back(itor);//add element to vector with copy constructor,use to add vector to other vector
                vecWidthAndColor.push_back(itor);//add element to vector by copy,use to copy vector to other vector
            }
        }
    };
}

